package nsh.cl.nd.khtn.mazedash;

import org.andengine.audio.sound.Sound;
import org.andengine.audio.sound.SoundFactory;

public class SoundMusicManager {
	private Sound scoreSound;
	private Sound clickSound;
	private Sound tikSound;
	private Sound startSound;
	private Sound wrongSound;
	private Sound gameoverSound;

	public void loadResource() {
		SoundFactory.setAssetBasePath("sfx/");

		try {
			scoreSound = SoundFactory.createSoundFromAsset(RootGameActivity.getInstance().getSoundManager(),
					RootGameActivity.getInstance(), "score.mp3");
			wrongSound = SoundFactory.createSoundFromAsset(RootGameActivity.getInstance().getSoundManager(),
					RootGameActivity.getInstance(), "wrong.wav");
			gameoverSound = SoundFactory.createSoundFromAsset(RootGameActivity.getInstance().getSoundManager(),
					RootGameActivity.getInstance(), "gameover.mp3");
			clickSound = SoundFactory.createSoundFromAsset(RootGameActivity.getInstance().getSoundManager(),
					RootGameActivity.getInstance(), "click.mp3");
			tikSound = SoundFactory.createSoundFromAsset(RootGameActivity.getInstance().getSoundManager(),
					RootGameActivity.getInstance(), "tik.mp3");
			startSound = SoundFactory.createSoundFromAsset(RootGameActivity.getInstance().getSoundManager(),
					RootGameActivity.getInstance(), "start.mp3");
		} catch (Exception e) {
			// TODO AHO log this
			// e.printStackTrace();
		}
	}

	public void playWrongSound() {
		wrongSound.play();
	}

	public void playScoreSound() {
		scoreSound.play();
	}

	public void playGameOverSound() {
		gameoverSound.play();
	}

	public void playClickSound() {
		clickSound.play();
	}

	public void playTikSound() {
		tikSound.play();
	}

	public void playStartSound() {
		startSound.play();
	}

}